import java.io.*;

public class ReadFile {

    private String[] name;
    private String[] location;
    private int numConnections;
    private int port;

    public ReadFile(File InputFile) throws FileNotFoundException, IOException {
        BufferedReader inputFile = new BufferedReader(new FileReader(InputFile));
        String inputStr = "";
        String[] inputStrArray = null;
        inputStr = inputFile.readLine();
        inputStrArray = inputStr.split("=");
        this.numConnections = new Integer(inputStrArray[1]);
        this.name = new String[this.numConnections];
        this.location = new String[this.numConnections];
        inputStr = inputFile.readLine();
        inputStrArray = inputStr.split("=");
        this.port = new Integer(inputStrArray[1]);

        for (int i = 0; i < this.numConnections; i++) {
            inputStr = inputFile.readLine();
            inputStrArray = inputStr.split("=");
            this.name[i] = inputStrArray[0]; // store name
            this.location[i] = inputStrArray[1];  // store location
            System.out.println(this.name[i] + " is located at " + this.location[i]);
        }

    }

    /**
     * @return the name
     */
    public String[] getName() {
        return name;
    }

    /**
     * @return the location
     */
    public String[] getLocation() {
        return location;
    }

    /**
     * @return the numConnections
     */
    public int getNumConnections() {
        return numConnections;
    }

    /**
     * @return the port
     */
    public int getPort() {
        return port;
    }

}